//
import {
  request,
  METHOD
} from '@/utils/request'
import axios from 'axios'

import Cookie from 'js-cookie'
const BASE_URL = process.env.VUE_APP_API_URL
/**
/*
分页查全部骑手
*/
export async function carHourseList (params) {
  return request(`${BASE_URL}/business/admin/vehicles/stock/list`, METHOD.GET, params)
}
export async function vehicleLifeCycleList (params) {
  return request(`${BASE_URL}/business/admin/vehicleLifeCycle/list`, METHOD.GET, params)
}

export async function getOneRecordList (params) {
  return request(`${BASE_URL}/business/admin/accessories/getOneRecord`, METHOD.GET, params)
}

//
export const inventoryRecordDownload = (id) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/accessories/list/inventoryRecord/download/${id}`,
    responseType: 'blob'
  })
}
//
export async function putInStorageVehicleInfoList (params) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo`, METHOD.GET, params)
}
// 入库车辆完善批量导出 1.4.1 骑圈

export const batchDownload = (params) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    timeout: 60 * 1000,
    url: `${BASE_URL}/business/admin/putInStorageVehicleInfo/batch/download`,
    responseType: 'blob',
    params
  })
}
export const vehicleMemberbatchDownload = (params) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    timeout: 60 * 1000,
    url: `${BASE_URL}/business/admin/vehicleMember/batch/download`,
    responseType: 'blob',
    params
  })
}
// export async function batchDownloadQrCode (params) {
//   return request(`${BASE_URL}/business/admin/vehicleMember/batch/download/qrcode`, METHOD.POST, params)
// }
export const batchDownloadQrCode = (data) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'post',
    timeout: 60 * 1000,
    url: `${BASE_URL}/business/admin/vehicleMember/batch/download/qrcode`,
    responseType: 'blob',
    data
  })
}

export const channelbatchDownload = (params) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    timeout: 60 * 1000,
    url: `${BASE_URL}/order/admin/vehicleOrder/list/download`,
    responseType: 'blob',
    params
  })
}
export const vehicleMemberbatchDownloadStore = (params) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    timeout: 60 * 1000,
    url: `${BASE_URL}/business/admin/vehicles/batch/download`,
    responseType: 'blob',
    params
  })
}
// 车型列表
export async function modelList (params) {
  return request(`${BASE_URL}/business/admin/vehicleModels`, METHOD.GET, params)
}
// 启用禁用
export async function modelEnableOrDisable (id) {
  return request(`${BASE_URL}/business/admin/vehicleModels/${id}/enableOrDisable`, METHOD.POST)
}

// 车型图片上传
export function modelUpload () {
  return `${BASE_URL}/business/admin/vehicleModels/uploadImage`
}
// 品牌分页
export async function brandList (params) {
  return request(`${BASE_URL}/business/admin/brands`, METHOD.GET, params)
}
export async function deviceModelInfoList (params) {
  return request(`${BASE_URL}/business/admin/deviceModelInfo`, METHOD.GET, params)
}
export async function deviceModelInfoDisable (id) {
  return request(`${BASE_URL}/business/admin/deviceModelInfo/${id}`, METHOD.PUT)
}

export async function illegalRemindList (params) {
  return request(`${BASE_URL}/member/admin/storeIllegal`, METHOD.GET, params)
}

export async function storeIllegalDetail (id) {
  return request(`${BASE_URL}/member/admin/storeIllegal/${id}`, METHOD.GET)
}

// 违法信息数据下载
export const illegalRemindDownload = (params) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    timeout: 60 * 1000,
    url: `${BASE_URL}/member/admin/storeIllegal/download`,
    responseType: 'blob',
    params
  })
}

// 历史违法查询
export async function illegalRemindHistory (code) {
  return request(`${BASE_URL}/member/admin/storeIllegal/history/${code}`, METHOD.GET)
}
// 口令
export async function commandList (params) {
  return request(`${BASE_URL}/member/admin/loginCodes`, METHOD.GET, params)
}
export async function checkDeviceNoTrue (params) {
  return request(`${BASE_URL}/business/admin/vehicleDeviceInfo/checkDeviceNo`, METHOD.POST, params)
}
export async function vehicleShelfInfoTrue (params) {
  return request(`${BASE_URL}/business/admin/vehicleShelfInfo/checkVinNo`, METHOD.POST, params)
}

export async function vehicleDeviceInfoList (params) {
  return request(`${BASE_URL}/business/admin/vehicleDeviceInfo`, METHOD.GET, params)
}
export async function vehicleControlOperationLogList (params) {
  return request(`${BASE_URL}/business/admin/vehicleControlOperationLog`, METHOD.GET, params)
}
export async function cancelDeviceNo (params) {
  return request(`${BASE_URL}/business/admin/vehicleDeviceInfo/cancelDeviceNo`, METHOD.POST, params)
}
export async function vehicleShelfInfo (params) {
  return request(`${BASE_URL}/business/admin/vehicleShelfInfo/cancelDeviceNo`, METHOD.POST, params)
}
export async function vehicleShelfInfoDetail (id) {
  return request(`${BASE_URL}/business/admin/vehicleShelfInfo/${id}`, METHOD.GET)
}
export async function commandLoginList (params) {
  return request(`${BASE_URL}/member/admin/loginCodes/license`, METHOD.GET, params)
}
export async function vehicleShelfInfoList (params) {
  return request(`${BASE_URL}/business/admin/vehicleShelfInfo`, METHOD.GET, params)
}

export async function loginCodesAdd (params) {
  return request(`${BASE_URL}/member/admin/loginCodes`, METHOD.POST, params)
}
export async function licenseLoginCodeAdd (params) {
  return request(`${BASE_URL}/member/admin/loginCodes/license`, METHOD.POST, params)
}
export async function licenseTestAdd (params) {
  return request(`${BASE_URL}/member/admin/loginCodes/createControlTestLoginCode`, METHOD.POST, params)
}
export async function loginCodesEdit (id, params) {
  return request(`${BASE_URL}/member/admin/loginCodes/${id}`, METHOD.PUT, params)
}
export async function keyGet (id) {
  return request(`${BASE_URL}/member/admin/loginCodes/${id}`, METHOD.GET)
}

// 入库车辆完善获取车牌 1.4.1 骑圈
export async function getLicensePlates (params) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/getLicensePlates`, METHOD.POST, params)
}
// 1.4.1 骑圈：运维-配件品类库 新增 修改品类 ）
export async function createAccessories (params) {
  return request(`${BASE_URL}/business/admin/accessories/createAccessories`, METHOD.POST, params)
}
export async function createAccessoriesEdit (params) {
  return request(`${BASE_URL}/business/admin/accessories/modifyAccessories`, METHOD.POST, params)
}
export async function accessoriesEdit (params) {
  return request(`${BASE_URL}/business/admin/accessories/modifyUpdateAccessoriesBrand`, METHOD.POST, params)
}
export async function storeAccessoriesApplyPut (id, params) {
  return request(`${BASE_URL}/business/admin/storeAccessoriesApply/${id}`, METHOD.PUT, params)
}
// 1.4.1 骑圈：运维-配件库 生成条形码（返回下载ID）
export async function createAccessoriesBarCode (params) {
  return request(`${BASE_URL}/business/admin/accessories/createAccessoriesBarCode`, METHOD.POST, params)
}

// 品牌状态
export async function brandOrDisable (id) {
  return request(`${BASE_URL}/business/admin/brands/${id}/enableOrDisable`, METHOD.POST)
}
// 渠道状态
export async function updateStatusDisable (id, data) {
  return request(`${BASE_URL}/order/admin/channelInfo/updateStatus/${id}`, METHOD.GET, data)
}
// 渠道详情
export async function channelInfoDetail (id) {
  return request(`${BASE_URL}/order/admin/channelInfo/${id}`, METHOD.GET)
}

export async function keyOrDisable (id) {
  return request(`${BASE_URL}/member/admin/loginCodes/${id}/enableOrDisable`, METHOD.POST)
}
//
export async function carStoreAllList () {
  return request(`${BASE_URL}/business/admin/stores/all/list`, METHOD.GET)
}
export async function likeStoreNameList (params) {
  return request(`${BASE_URL}/business/admin/stores/list/likeStoreName`, METHOD.GET, params)
}
//
export const carTemplate = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/vehicles/import/getvehiclesInfosFilterExcelTemplate`,
    responseType: 'blob'
  })
}
export async function carImportant (data) {
  return request(`${BASE_URL}/business/admin/vehicles/import/vehiclesInfosFilterExcel`, METHOD.POST, data)
}
export async function putInStorageImportant (data) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/import`, METHOD.POST, data)
}
// 车辆调度分页
export async function schedulingList (params) {
  return request(`${BASE_URL}/business/admin/vehicleSchedule`, METHOD.GET, params)
}
// 测试记录
export async function commandLogList (params) {
  return request(`${BASE_URL}/control/admin/commandLog`, METHOD.GET, params)
}
export async function stockStoreInfoList (params) {
  return request(`${BASE_URL}/business/admin/stores/stockStoreInfo`, METHOD.GET, params)
}
// 运维-配件品类库，管理首页分页查询
export async function accessoriesList (params) {
  return request(`${BASE_URL}/business/admin/accessories/list`, METHOD.GET, params)
}
// 车辆列表 分页查
export async function vehicleList (params) {
  return request(`${BASE_URL}/business/admin/vehicleMember`, METHOD.GET, params)
}
export async function overdueConfig (params) {
  return request(`${BASE_URL}/order/admin/overdueConfig`, METHOD.GET)
}
export async function overdueConfigLogList (params) {
  return request(`${BASE_URL}/order/admin/overdueConfigLog`, METHOD.GET, params)
}
export async function overdueConfigSet (params) {
  return request(`${BASE_URL}/order/admin/overdueConfig`, METHOD.POST, params)
}
// 新增车辆
export async function AddVehicle (data) {
  return request(`${BASE_URL}/business/admin/vehicleMember`, METHOD.POST, data)
}
// 修改车辆
export async function upDateVehicle (vehicleId, vehicleStatus) {
  return request(`${BASE_URL}/business/admin/vehicleMember/${vehicleId}/status/${vehicleStatus}`, METHOD.PUT)
}

// 修改车辆 回显
export async function upDateVehicleGet (vehicleId) {
  return request(`${BASE_URL}/business/admin/vehicleMember/${vehicleId}`, METHOD.GET)
}

// 根据id查询用车记录
export async function vehicleMemberList (vehicleId, params) {
  return request(`/business/admin/vehicleMember/list/${vehicleId}`, METHOD.GET, params)
}

// 绑定车辆给用户
export async function userCarBind (data) {
  return request(`${BASE_URL}/business/admin/vehicleMember/bindMember`, METHOD.POST, data)
}

// 全部骑手
export async function memberList (data) {
  return request(`${BASE_URL}/member/admin/storeMembers/list/all`, METHOD.GET, data)
}
// 解绑车辆
export async function unbindMember (vehicleId) {
  return request(`${BASE_URL}/business/admin/vehicleMember/unbindMember/${vehicleId}`, METHOD.POST)
}

// 车辆调度提交
export async function vehicleSchedule (data) {
  return request(`${BASE_URL}/business/admin/vehicleSchedule`, METHOD.POST, data)
}

// 车辆报警
export async function realtimeAlarmDml (params) {
  return request(`${BASE_URL}/business/admin/alarm`, METHOD.GET, params)
}
export async function vehicleExceptionList (params) {
  return request(`${BASE_URL}/statistical/admin/vehicleException/list`, METHOD.GET, params)
}
export async function vehicleExceptionDetail (id) {
  return request(`${BASE_URL}/statistical/admin/vehicleException/detail/${id}`, METHOD.GET)
}

// 报警枚举查询
export async function enumsList () {
  return request(`${BASE_URL}/business/admin/alarm/enums`, METHOD.GET)
}
// 报警处理
export async function updateEntity (data) {
  return request(`${BASE_URL}/soco/realtimeAlarm/updateEntity`, METHOD.POST, data)
}

// 轨迹分页
export async function updateTrailGet (data) {
  return request(`${BASE_URL}/business/admin/vehicleTrail`, METHOD.GET, data)
}

// 单次轨迹 查询list
export async function apiOrAdminGet (id, data) {
  console.log(id, data, '????')
  return request(`${BASE_URL}/business/admin/vehicleTrail/${id}?deviceNo=${data}`, METHOD.GET)
}
// 车辆实时定位
export async function realTimeStateGet (deviceNo) {
  return request(`${BASE_URL}/soco/realTimeState/current/${deviceNo}`, METHOD.GET)
}
// 根据车辆Id查询用车记录

export async function getByVehicleId (params) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/findUseRecordByVehicleId`, METHOD.GET, params)
}
export async function storeAccessoriesList (params) {
  return request(`${BASE_URL}/business/admin/storeAccessories`, METHOD.GET, params)
}
export async function storeAccessoriesItemList (params) {
  return request(`${BASE_URL}/business/admin/storeAccessoriesItem`, METHOD.GET, params)
}
export async function inventoryList (params) {
  return request(`${BASE_URL}/business/admin/accessories/list/inventory`, METHOD.GET, params)
}
// 运维-配件库-配件详情-库存编号，分页查询
export async function inventoryNoList (params) {
  return request(`${BASE_URL}/business/admin/accessories/list/inventoryNo`, METHOD.GET, params)
}
// 运维-配件库-配件详情-配件编号批次，分页查询
export async function inventoryRecordList (params) {
  return request(`${BASE_URL}/business/admin/accessories/list/inventoryRecord`, METHOD.GET, params)
}
// 锁车记录
export async function lockList (params) {
  return request(`${BASE_URL}/business/admin/vehicleMember`, METHOD.GET, params)
}

// 车辆审核
export async function auditList (params) {
  return request(`${BASE_URL}/business/admin/vehicleLock/audit/list`, METHOD.GET, params)
}
// 车辆审核
export async function vehicleShelfApplyList (params) {
  return request(`${BASE_URL}/business/admin/vehicleShelfApply/list`, METHOD.GET, params)
}
// 意见反馈 管理列表页
export async function feedBackList (params) {
  return request(`${BASE_URL}/member/admin/members/feedBack/list`, METHOD.GET, params)
}
// 车辆信息变更提醒
export async function listDispatchForNotice (params) {
  return request(`${BASE_URL}/business/admin/vehicleDispatch/listDispatchForNotice`, METHOD.GET, params)
}

// 租赁方式更换-审核
export async function vehicleShelfApplyEdit (params) {
  return request(`${BASE_URL}/business/admin/vehicleShelfApply/audit`, METHOD.POST, params)
}
// 意见反馈 提交处理
export async function submitNoticeFeedBack (params) {
  return request(`${BASE_URL}/member/admin/members/feedBack/submitNotice`, METHOD.POST, params)
}
export async function submitNotice (params) {
  return request(`${BASE_URL}/business/admin/vehicleDispatch/submitNotice`, METHOD.POST, params)
}
// 批量上架
export async function batchAvailableOn (params) {
  return request(`${BASE_URL}/business/admin/vehicles/batchAvailableOn`, METHOD.POST, params)
}
// 批量下架
export async function batchAvailableOff (params) {
  return request(`${BASE_URL}/business/admin/vehicles/batchAvailableOff`, METHOD.POST, params)
}
// 上架
export async function updateAvailableOn (params) {
  return request(`${BASE_URL}/business/admin/vehicles/updateAvailableOn`, METHOD.POST, params)
}
// 下架
export async function updateAvailableOff (params) {
  return request(`${BASE_URL}/business/admin/vehicles/updateAvailableOff`, METHOD.POST, params)
}

// 商户车辆批量上架
export async function merchantBatchAvailableOn (params) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/batchAvailableOn`, METHOD.POST, params)
}
// 商户车辆批量下架
export async function merchantBatchAvailableOff (params) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/batchAvailableOff`, METHOD.POST, params)
}
// 商户车辆上架
export async function merchantUpdateAvailableOn (params) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/updateAvailableOn`, METHOD.POST, params)
}
// 商户车辆下架
export async function merchantUpdateAvailableOff (params) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/updateAvailableOff`, METHOD.POST, params)
}

export async function gpsOnDeviceNo (deviceNo) {
  return request(`${BASE_URL}/control/admin/cmd/gpsOn/${deviceNo}`, METHOD.GET)
}
// 出库单单条撤回
export async function withdrawBoundOrder (params) {
  return request(`${BASE_URL}/business/admin/bound/withdrawBoundOrder`, METHOD.POST, params)
}
export async function listPaymentList (orderId) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/listPayment/${orderId}`, METHOD.GET)
}
export async function vehicleDeviceInfoDetail (id) {
  return request(`${BASE_URL}/business/admin/vehicleDeviceInfo/${id}`, METHOD.GET)
}
export async function listAgreementPayment (orderId) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/listAgreementPayment/${orderId}`, METHOD.GET)
}
export async function huabeiToChargeChange (id) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/${id}/huabeiToCharge`, METHOD.POST)
}
export async function agreementPaymentToCharge (id, data) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/${id}/agreementPaymentToCharge`, METHOD.POST, data)
}

// 以下接口为运营-配件申请审核
// 配件申请审核列表
export async function getPartsApplyList (params) {
  return request(`${BASE_URL}/business/admin/storeAccessoriesApply`, METHOD.GET, params)
}
// 配件申请审核详情
export async function getPartsApplyDetail (id) {
  return request(`${BASE_URL}/business/admin/storeAccessoriesApply/${id}`, METHOD.GET)
}

// 记录统计
export async function statisticalRecordList (params) {
  return request(`${BASE_URL}/business/admin/vehicleControl/statisticalRecord`, METHOD.GET, params)
}

// 记录统计 -统计信息
export async function statisticalRecordCount (params) {
  return request(`${BASE_URL}/business/admin/vehicleControl/statisticalRecord/count`, METHOD.GET, params)
}
// 运营管理-车控关联管理-记录统计-设备号-批次详情
export async function deviceDetailBatchNo (batchNo) {
  return request(`${BASE_URL}/business/admin/vehicleControl/statisticalRecord/deviceDetail/${batchNo}`, METHOD.GET)
}
export async function deviceListBatchNo (params) {
  return request(`${BASE_URL}/business/admin/vehicleControl/statisticalRecord/deviceList`, METHOD.GET, params)
}
export async function vinDetailBatchNo (batchNo) {
  return request(`${BASE_URL}/business/admin/vehicleControl/statisticalRecord/vinDetail/${batchNo}`, METHOD.GET)
}
export async function vinListBatchNo (params) {
  return request(`${BASE_URL}/business/admin/vehicleControl/statisticalRecord/vinList`, METHOD.GET, params)
}
// 车辆-车辆详情-创建维修单
export async function CreatepartsOrder (params) {
  return request(`${BASE_URL}/todo/admin/repairOrders`, METHOD.POST, params)
}

// 车辆-车辆详情-创建维修单-维修配件列表
export async function partsList (params) {
  return request(`${BASE_URL}/business/admin/accessories/repair/list`, METHOD.GET, params)
}
// 车辆-车辆列表-查询历史信息
export async function historyInfoList (params) {
  return request(`${BASE_URL}/business/admin/vehicle/change/record/list`, METHOD.GET, params)
}
// 创建维修单 计算价格
export async function calculatePartsSum (params) {
  return request(`${BASE_URL}/business/admin/repairUnits/confirmRequestRepairUnits`, METHOD.POST, params)
}

// 租赁方式更换申请-列表
export async function vehicleLeaseChangeApplyList (params) {
  return request(`${BASE_URL}/business/admin/vehicleLeaseChangeApply/list`, METHOD.GET, params)
}

// 租赁方式更换申请-详情
export async function vehicleLeaseChangeApplyDetail (id) {
  return request(`${BASE_URL}/business/admin/vehicleLeaseChangeApply/detail/${id}`, METHOD.GET)
}

// 租赁方式更换申请-审核
export async function vehicleLeaseChangeApplyAudit (params) {
  return request(`${BASE_URL}/business/admin/vehicleLeaseChangeApply/audit`, METHOD.POST, params)
}
// 车辆详情-车辆控制-一键启动
export async function launchCar (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/start`, METHOD.POST, params)
}

// 车辆详情-车辆控制-一键寻车
export async function findCar (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/find`, METHOD.POST, params)
}

// 车辆详情-车辆控制-降速
export async function speedSlowDown (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/speedDown`, METHOD.POST, params)
}

// 车辆详情-车辆控制-解锁
export async function unLockCar (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/lock`, METHOD.POST, params)
}
// 车辆详情-车辆控制-锁定
export async function lockCar (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/unLock`, METHOD.POST, params)
}
// 车辆详情-车辆控制-车控启用
export async function enableCar (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/controlEnabled`, METHOD.POST, params)
}
// 车辆详情-车辆控制-车控停用
export async function unEnableCar (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/controlDeactivate`, METHOD.POST, params)
}

// 出库管理-签收
export async function signOutBound (params) {
  return request(`${BASE_URL}/business/admin/bound/sign`, METHOD.POST, params)
}

// 车辆-出库管理-列表-根据出库ID查询需要签收的物流列表
export async function waitSignList (id) {
  return request(`${BASE_URL}/business/admin/bound/waitSignList/${id}`, METHOD.GET)
}

// 门店调度-签收
export async function signDispatch (params) {
  return request(`${BASE_URL}/business/admin/vehicleDispatch/sign`, METHOD.POST, params)
}
// 车空关联管理-记录统计-车架号-批次详情-导出
export const vnNoDownload = (batchNo) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/vehicleControl/statisticalRecord/vinExport/${batchNo}`,
    responseType: 'blob'
  })
}

// 车空关联管理-记录统计-设备号-批次详情-导出

export const deviceNoDownload = (batchNo) => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/vehicleControl/statisticalRecord/deviceExport/${batchNo}`,
    responseType: 'blob'
  })
}

// 入库车辆-车空解绑
export async function vehicleUnBind (params) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/unbind`, METHOD.POST, params)
}
// 商户订单详情-结算信息查询
export async function settltmentInfo (id) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/findSettlementInfo/${id}`, METHOD.GET)
}

// 违法短信提醒
export async function illegalSmsSend (id) {
  return request(`${BASE_URL}/member/admin/storeIllegal/smsSend/${id}`, METHOD.GET)
}

// 物流签收/拒签图片上传
export function uploadLogisticsSignImage () {
  return `${BASE_URL}/business/admin/bound/uploadLogisticsSignImage`
}
// 车辆信息更改记录类型
export async function findChangeType (isQq) {
  return request(`${BASE_URL}/business/admin/vehicle/change/record/findChangeType/${isQq}`, METHOD.GET)
}
// 获取车辆信息轻量化接口
export async function getCarBasic (data) {
  return request(`${BASE_URL}/business/admin/vehicles/basic`, METHOD.GET, data)
}

// 租金区间-列表 1.6.1
export async function priceQujian (params) {
  return request(`${BASE_URL}/business/admin/rentRange/list`, METHOD.GET, params)
}
// 租金区间-租期字典 1.6.1
export async function zuqiList () {
  return request(`${BASE_URL}/business/admin/rentRange/findLeaseType`, METHOD.GET)
}
// 租金区间-租期新增 1.6.1
export async function zuqiAdd (params) {
  return request(`${BASE_URL}/business/admin/rentRange`, METHOD.POST, params)
}
// 租金区间-租期修改 1.6.1
export async function zuqiEdit (id, params) {
  return request(`${BASE_URL}/business/admin/rentRange/${id}`, METHOD.PUT, params)
}
// 租金区间-租期删除 1.6.1
export async function zuqiDel (id) {
  return request(`${BASE_URL}/business/admin/rentRange/${id}`, METHOD.DELETE)
}
// 基础/工单标签列表 1.6.1
export async function workOrderList (params) {
  return request(`${BASE_URL}/business/admin/base/workorder/label/pagelist`, METHOD.GET, params)
}
// 基础/新增工单标签 1.6.1
export async function addWorkOrder (params) {
  return request(`${BASE_URL}/business/admin/base/workorder/label/create`, METHOD.POST, params)
}
// 基础/修改工单标签 1.6.1
export async function editWorkOrder (params) {
  return request(`${BASE_URL}/business/admin/base/workorder/label/update`, METHOD.POST, params)
}
// 基础/工单删除 1.6.1
export async function workWordDel (id) {
  return request(`${BASE_URL}/business/admin/base/workorder/label/delete/${id}`, METHOD.POST)
}
// 基础/新增子工单 1.6.1
export async function addChildWorkOrder (params) {
  return request(`${BASE_URL}/business/admin/base/workorder/label/sub/create`, METHOD.POST, params)
}
// 基础/子工单标签列表 1.6.1
export async function childWorkOrderList (params) {
  return request(`${BASE_URL}/business/admin/base/workorder/label/sub/pagelist`, METHOD.GET, params)
}
// 基础/子工单删除 1.6.1
export async function childWorkWordDel (id) {
  return request(`${BASE_URL}/business/admin/base/workorder/label/sub/delete/${id}`, METHOD.POST)
}

// 1.6.2 车辆管理-商户自有车辆-详情-报废车辆
export async function baofeiCar (params) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/scrap`, METHOD.POST, params)
}

// 1.6.3 电子围栏预警列表
export async function alarmList (params) {
  return request(`${BASE_URL}/business/admin/fenceAlarm/listPage`, METHOD.GET, params)
}
// 1.6.3 电子围栏标记为已处理
export async function flagAlarm (params) {
  return request(`${BASE_URL}/business/admin/fenceAlarm/process`, METHOD.GET, params)
}
// 1.6.3 电子围栏批量标记为已处理
export async function batchAlarm (params) {
  return request(`${BASE_URL}/business/admin/fenceAlarm/batchProcess`, METHOD.POST, params)
}
// 1.6.3 导出围栏预警数据
export const exportAlarm = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/fenceAlarm/export/`,
    responseType: 'blob'
  })
}

// 1.6.4 物联网卡维护-列表
export async function lotCardList (params) {
  return request(`${BASE_URL}/business/admin/simManualConfig/list`, METHOD.GET, params)
}
// 1.6.4 物联网卡维护-删除
export async function lotCardDel (id) {
  return request(`${BASE_URL}/business/admin/simManualConfig/${id}`, METHOD.DELETE)
}
// 1.6.4 物联网卡维护-下载模板
export const downloadTemplate = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/simManualConfig/getSimExcelTemplate`,
    responseType: 'blob'
  })
}
// 1.6.4 物联网卡维护-导入
export async function lotCardImportant (data) {
  return request(`${BASE_URL}/business/admin/simManualConfig/importSim`, METHOD.POST, data)
}

// 1.6.5 商户自有车辆清除租金
export async function selfClearRent (data) {
  return request(`${BASE_URL}/business/admin/vehicleMember/clearRent`, METHOD.POST, data)
}
// 车库列表-车辆详情-车辆履历-基本信息
export async function carBasicInfoDTO (vehicleId) {
  return request(`${BASE_URL}/business/admin/vehicleCurriculumVitae/basicInfo/${vehicleId}`, METHOD.GET)
}
// 车库列表-车辆详情-车辆履历-出入库记录
export async function carOutInLogList (data) {
  return request(`${BASE_URL}/business/admin/vehicleCurriculumVitae/findInoutBoundRecord`, METHOD.GET, data)
}
// 车库列表-车辆详情-车辆履历-调度记录
export async function carDispatchLogList (data) {
  return request(`${BASE_URL}/business/admin/vehicleCurriculumVitae/findDispatchRecord`, METHOD.GET, data)
}
// 车库列表-车辆详情-车辆履历-维修记录
export async function carRepairLogList (data) {
  return request(`${BASE_URL}/todo/admin/repairOrders/findRepairRecord`, METHOD.GET, data)
}

// 车库列表-车辆详情-车辆履历-租赁
export async function carRentLogList (data) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/findRentRecord`, METHOD.GET, data)
}
// 车库列表-车辆详情-车辆履历-履历时间线
export async function historyTimeLine (vehicleId) {
  return request(`${BASE_URL}/business/admin/vehicleCurriculumVitae/timeline/${vehicleId}`, METHOD.GET)
}
// 车库列表-车辆详情-车辆履历-车辆配件变更记录
export async function carPartsHistory (vehicleId) {
  return request(`${BASE_URL}/todo/admin/repairOrders/statistics/${vehicleId}`, METHOD.GET)
}
// 车库列表-车辆详情-车辆履历-车辆配件变更记录详情
export async function carPartsHistoryDetail (data) {
  return request(`${BASE_URL}/todo/admin/repairOrders/statistics/detail`, METHOD.GET, data)
}
// 车库列表-车辆详情-车辆履历-维修记录
export async function carRepairHistory (data) {
  return request(`${BASE_URL}/todo/admin/repairOrders/getByTime`, METHOD.GET, data)
}

// 车辆-车库车辆维修
export async function carRepairLog (data) {
  return request(`${BASE_URL}/todo/admin/repairRecord`, METHOD.GET, data)
}
// 车辆-车库车辆维修详情
export async function carRepairLogDetail (id) {
  return request(`${BASE_URL}/todo/admin/repairRecord/${id}`, METHOD.GET)
}
// 车辆-中控-中控黑名单列表
export async function deviceBlackList (data) {
  return request(`${BASE_URL}/business/admin/deviceBlacklist`, METHOD.GET, data)
}
// 车辆-中控-恢复车控
export async function resumeDevice (data) {
  return request(`${BASE_URL}/business/admin/deviceBlacklist/resume`, METHOD.POST, data)
}
// 车辆-中控-车控列表导出
export const blackListExport = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/deviceBlacklist/export`,
    responseType: 'blob'
  })
}

/**
 * 硬件设备管理
 */

// 查询列表 1.6.7
export async function hardwareDevice (data) {
  return request(`${BASE_URL}/business/admin/hardwareDevice`, METHOD.GET, data)
}

// 新增设备 1.6.7
export async function addHardwareDevice (deviceNo) {
  return request(`${BASE_URL}/business/admin/hardwareDevice/${deviceNo}`, METHOD.POST)
}

// 状态变更 1.6.7
export async function hardwareDeviceStatus (data) {
  return request(`${BASE_URL}/business/admin/hardwareDevice/status`, METHOD.POST, data)
}

// 删除设备 1.6.7
export async function hardwareDeviceDelete (id) {
  return request(`${BASE_URL}/business/admin/hardwareDevice/${id}`, METHOD.DELETE)
}

// 硬件设备管理-下载模板 1.6.7
export const getExcelTemplate = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/hardwareDevice/getExcelTemplate`,
    responseType: 'blob'
  })
}
// 硬件设备管理-导入 1.6.7
export async function importHardWareDevice (data) {
  return request(`${BASE_URL}/business/admin/hardwareDevice/importHardWareDevice`, METHOD.POST, data)
}

// 车库列表-修改资产方
export async function changeAsset (data) {
  return request(`${BASE_URL}/business/admin/vehicles/changeAsset`, METHOD.PUT, data)
}

// 车库列表-获取车辆分配信息
export async function geiAllocationInfo (data) {
  return request(`${BASE_URL}/business/admin/vehicles/allocationInfo`, METHOD.GET, data)
}
// 车库列表-加入分配表
export async function addAllocation (data) {
  return request(`${BASE_URL}/business/admin/vehicles/addAllocation`, METHOD.PUT, data)
}
// 禁用车控权限-添加中控黑名单
export async function addBlackListItem (data) {
  return request(`${BASE_URL}/business/admin/deviceBlacklist`, METHOD.POST, data)
}

// 设备号查询记录 1.6.7 LS
export async function hardwareDeviceSearchLog (data) {
  return request(`${BASE_URL}/business/admin/hardwareDevice/searchLog`, METHOD.GET, data)
}
// 自有车辆-禁用车控
export async function qqAddDeviceBlack (data) {
  return request(`${BASE_URL}/business/admin/vehicle/control/addDeviceBlack`, METHOD.POST, data)
}
// 自有车辆-恢复车控
export async function qqResumeDevice (data) {
  return request(`${BASE_URL}/business/admin/vehicle/control/resumeDevice`, METHOD.POST, data)
}

// 非自有车辆-禁用车控
export async function merchatAddDeviceBlack (data) {
  return request(`${BASE_URL}/business/admin/vehicle/control/merchant/addDeviceBlack`, METHOD.POST, data)
}
// 非自有车辆-恢复车控

export async function merchatResumeDevice (data) {
  return request(`${BASE_URL}/business/admin/vehicle/control/merchant/resumeDevice`, METHOD.POST, data)
}
// 车辆详情-车辆标记
export async function carTips () {
  return request(`${BASE_URL}/business/admin/vehicleLabelLog/listByName`, METHOD.GET)
}
// 还车确认-车辆检验记录
export async function checkedRecordList (vehicleId) {
  return request(`${BASE_URL}/business/admin/vehicleCheck/vehicle/${vehicleId}`, METHOD.GET)
}
// 新增出库单-上传关联图片
export function uploadBoundPic () {
  return `${BASE_URL}/business/admin/bound/uploadPic`
}
// 租金明细-扣款记录
export async function chargeRecord (agreementPaymentChargeLogId) {
  return request(`${BASE_URL}/order/admin/agreementPaymentList/getByAgreementPaymentChargeLogId/${agreementPaymentChargeLogId}`, METHOD.GET)
}

// 租金明细-线下支付
export async function agreementPaymentOfflinePayment (id) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/${id}/agreementPaymentOfflinePayment`, METHOD.POST)
}
// 1.6.8 骑手可用优惠券列表
export async function createOrderQuan (data) {
  return request(`${BASE_URL}/promotion/admin/coupons/avaliableListByUser`, METHOD.GET, data)
}
// 1.6.8 后台租车订单预提交接口
export async function prepareSubmit (data) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/preCommit`, METHOD.POST, data)
}
// 1.6.8 后台租车订单创建订单提交接口
export async function createdOrderSubmit (data) {
  return request(`${BASE_URL}/order/admin/vehicleOrder/createVehicleOrder`, METHOD.POST, data)
}
// 1.6.8 骑手可用优惠券
export async function isQuan (data) {
  return request(`${BASE_URL}/promotion/admin/coupons/avaliableListByUser`, METHOD.GET, data)
}
// 1.6.9 添加车架号-获取导入模板
export const getCarShelfTemplate = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/vehicleShelfInfo/getVinExcelTemplate`,
    responseType: 'blob'
  })
}
// 1.6.9 添加车架号-导入验证
export async function uploadVinNoByExcel (data) {
  return request(`${BASE_URL}/business/admin/vehicleShelfInfo/uploadVinNoByExcel`, METHOD.POST, data)
}
// 1.6.9 添加设备号-获取导入模板
export const getDeviceTemplate = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/vehicleDeviceInfo/getDeviceExcelTemplate`,
    responseType: 'blob'
  })
}
// 1.6.9 添加车架号-导入验证
export async function uploadDeviceByExcel (data) {
  return request(`${BASE_URL}/business/admin/vehicleDeviceInfo/uploadDeviceByExcel`, METHOD.POST, data)
}
// 1.6.9 出库添加车辆模板
export const getVehicleExcelTemplate = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/bound/getVehicleExcelTemplate`,
    responseType: 'blob'
  })
}
// 1.6.9 出库导入车辆验证
export async function uploadVehicleByExcel (data) {
  return request(`${BASE_URL}/business/admin/bound/uploadVehicleByExcel`, METHOD.POST, data)
}
// 1.6.9 调度导入车辆验证
export async function uploadVehicleDispatchByExcel (data) {
  return request(`${BASE_URL}/business/admin/vehicleDispatch/uploadVehicleByExcel`, METHOD.POST, data)
}
// 批量注销车辆-下载模板 1.6.9 YB
export const getCancelExcelTemplate = () => {
  const queryParams = {
    Authorization: Cookie.get('Authorization')
  }
  Object.assign(queryParams)
  return axios({
    method: 'get',
    url: `${BASE_URL}/business/admin/vehicles/getCancelExcelTemplate`,
    responseType: 'blob'
  })
}

// 批量注销车辆-验证 1.6.9 YB
export async function validCancelVehicleNos (params) {
  return request(`${BASE_URL}/business/admin/vehicles/validCancelVehicleNos`, METHOD.POST, params)
}

// 批量注销车辆-导入车架号 1.6.9 YB
export async function importVehicleNos (data) {
  return request(`${BASE_URL}/business/admin/vehicles/importVehicleNos`, METHOD.POST, data)
}
// 骑圈自有车辆-批量注销车辆 1.6.9 YB
export async function batchCancelVehicle (params) {
  return request(`${BASE_URL}/business/admin/vehicles/batchCancel`, METHOD.POST, params)
}
// 商户自有车辆-批量注销车辆 1.6.9 YB
export async function merchantBatchCancelVehicle (params) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/batchCancel`, METHOD.POST, params)
}
// 1.6.9 骑圈自有车辆-检验记录
export async function getCheckList (data) {
  return request(`${BASE_URL}/business/admin/vehicleMember/findCheckRecord`, METHOD.GET, data)
}
// 1.7.0 骑圈自有车辆更换设备号
export async function qqChangeDevice (params) {
  return request(`${BASE_URL}/business/admin/vehicleMember/changeDevice`, METHOD.POST, params)
}
// 1.7.0 商户自有车辆更换设备号
export async function shChangeDevice (params) {
  return request(`${BASE_URL}/business/admin/vehicleMember/merchant/changeDevice`, METHOD.POST, params)
}
// 1.7.0 创建找车单
export async function createInsert (params) {
  return request(`${BASE_URL}/order/admin/vehicleSearch/insert`, METHOD.POST, params)
}
// 1.7.0 根据车辆品牌Id和设备编号查询最后定位
export async function getLastLocation (data) {
  return request(`${BASE_URL}/business/admin/vehicleMember/getVehicleLastLocationAddress`, METHOD.GET, data)
}
// 1.7.0 找车单详情
export async function getFindCarList (data) {
  return request(`${BASE_URL}/order/admin/vehicleSearch/pageList`, METHOD.GET, data)
}
//   XB 查询账户列表byParams 1.7.1
export async function listByParams (data) {
  return request(`${BASE_URL}/member/admin/users/listByParams`, METHOD.GET, data)
}

//    XB 查询所有为平台管理员账号及部门数据 1.7.1
export async function listDepartmentAndMember () {
  return request(`${BASE_URL}/member/admin/users/listDepartmentAndMember`, METHOD.GET)
}

// 车辆管理-车辆调度发货单-列表 1.7.1 WYJ
export async function warehouseVehicleDispatchDeliveryList (data) {
  return request(`${BASE_URL}/business/admin/warehouseVehicleDispatchDeliveryInfo/pageList`, METHOD.GET, data)
}
// 车辆管理-车辆调度发货单-列表-查看 1.7.1 WYJ
export async function warehouseVehicleDispatchDeliveryDetail (id) {
  return request(`${BASE_URL}/business/admin/warehouseVehicleDispatchDeliveryInfo/detail/${id}`, METHOD.GET)
}

// 骑圈后台-车辆-设备号修改审核-列表 1.7.1 WYJ
export async function deviceChangeAuditList (data) {
  return request(`${BASE_URL}/business/admin/deviceChangeAudit/page`, METHOD.GET, data)
}

// 骑圈后台-车辆-设备号修改审核-列表-查看 1.7.1 WYJ
export async function deviceChangeAuditDetail (id) {
  return request(`${BASE_URL}/business/admin/deviceChangeAudit/detail/${id}`, METHOD.GET)
}

// 骑圈后台-车辆-设备号修改审核-列表-审核 1.7.1 WYJ
export async function deviceChangeAudit (params) {
  return request(`${BASE_URL}/business/admin/deviceChangeAudit/audit`, METHOD.POST, params)
}

// 管理后台-骑圈自有车辆-车辆详情-车辆控制－查询状态 WYJ
export async function controlStatus (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/controlStatus`, METHOD.POST, params)
}

// 管理后台-商户自有车辆-车辆详情-车辆控制－查询状态 WYJ
export async function merchantControlStatus (params) {
  return request(`${BASE_URL}/business/admin/vehicle/control/merchant/controlStatus`, METHOD.POST, params)
}
